<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue 测试实例 - 菜鸟教程(runoob.com)</title>
<script src="./vue.js"></script>
<!-- <script src="vue-resource.js"></script> -->
<script src="axios.min.js"></script>
</head>
<body>
<div id="app">
  <!-- <ol>
    <li v-for="(value, key, index) in sites">
      {{ value.name }}与{{ value.lognname }}{{value}}+{{key}}
    </li>
  </ol> -->
</div>

<script>
var demo = new Vue({
  el: '#app',
  /*data: {
    sites: [
      { name: 'Runoob' ,lognname:"abc"},
      { name: 'Google' ,lognname:"efg"},
      { name: 'Taobao' ,lognname:"hik"}
    ]
  },*/
  data: {
            show: false,
            gridColumns: [{
                name: 'brandId',
                isKey: true
            }, {
                name: 'name'
            }, {
                name: 'photo'
            }],
            gridData: [],
            apiUrl: 'http://api.tb-bihaohuo.cn/Home/brands',
            item: {}
        },
  ready: function() {
            console.log("中国人");
            this.getCustomers()
        },
        methods: {
          
            getCustomers: function() {
                alert("wer");
                var vm = this
            // vm.$http.get(vm.apiUrl)
            //   .then((response) => {
            //     console.log(response);
            //     vm.$set('gridData', response.data);
            //      console.log(vm.gridData.brands);
            //   })

            axios.get(vm.apiUrl)
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });
            },
            
        }
})
</script>
</body>
</html>